}class Child{
    private String name;
    private int age;
    private String gender;
    private int height;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public Child(String name, int age, String gender, int height) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.height = height;
    }

    @Override
    public String toString() {
        if (this.gender.equals("M")){
            return "男孩" + this.name + "的年龄是" + this.age + "岁,身高是" + this.height + "厘米";
        }else {
            return "女孩" + this.name + "的年龄是" + this.age + "岁,身高是" + this.height + "厘米";
        }
    }
}

class BodyCheck{
    private int standardHeight;

    public void calcStandardHeight(Child c){
        if(c.getGender().equals("M")){
            standardHeight = c.getAge() * 6 + 75;
        }else{
            standardHeight = c.getAge() * 6 + 70;
        }
    }
    public void checkHeight(Child c) throws heightException{
        calcStandardHeight(c);
        if (c.getHeight() < this.standardHeight){
            throw new heightException(c.getName() + "小朋友身高不达标,还差" + (this.standardHeight - c.getHeight()) + "厘米" );
        }else {
            System.out.println(c.getName() + "小朋友身高达标");
        }
    }
}
class heightException extends Exception{
    private String msg;

    @Override
    public String toString() {
        return msg;
    }

    public heightException(String msg){
        this.msg = msg;
    }
}

